<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--
  实现1-20数字的平均值
-->

<script>

    var sum = 0;
    for (var i = 1; i < 21 ; i++) {
        sum+=i;
    }
    console.log(sum/20)

</script>
</body>
</html>